package com.rpc.test.server.flow.flows;

import java.util.Random;
import rpc.core.BaseAsyncFlow;
import rpc.core.annotations.Flow;
import rpc.trace.Trace;
import rpc.trace.TraceContext;

@Flow("ProducerApi.hi")
public class Flow2 extends BaseAsyncFlow {

  @Override
  public void enter() {
    TraceContext traceContext = Trace.get();
//    delay("inner.delay", new FlowReq());
//    String autoWeb = strConfig("rpc.web.autoWeb1");
//    int port = intConfig("rpc.web.port1", 5555);
//    post("inner.test2", new FlowReq());
//    post("inner.post", new FlowReq().setMaxCount(5).setDelayTimes(1, 2, 3, 4));
    double millis = new Random().nextDouble() * 1000;

    this.invoke(this::retRes, "producerapi.hi2", req.append("millis", millis));
//    String seq = this.req.ns("seq");
//    reply(new FlowRes().append("seq", seq).append("millis", millis));
  }
}
